//
//  ButtonViewController.m
//  Button
//

#import "ButtonViewController.h"

@implementation ButtonViewController

- (void)checkboxClick:(UIButton *)sender {
	sender.selected = !sender.selected;
}

- (void)viewDidLoad {
    [super viewDidLoad];
	
	UIButton *checkbox = [UIButton buttonWithType:UIButtonTypeCustom];

	[checkbox setFrame:CGRectMake(135, 150, 36, 36)];

	[checkbox setImage:[UIImage imageNamed:@"checkbox_off.png"] forState:UIControlStateNormal];
	[checkbox setImage:[UIImage imageNamed:@"checkbox_on.png"] forState:UIControlStateSelected];

	[checkbox addTarget:self action:@selector(checkboxClick:) forControlEvents:UIControlEventTouchUpInside];
	
	[self.view addSubview:checkbox];
}

- (void)dealloc {
    [super dealloc];
}

@end
